package org.example.kidscode.service.impl;

import org.example.kidscode.entity.CardStatistics;
import org.example.kidscode.repository.CardStatisticsRepository;
import org.example.kidscode.service.CardStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class CardStatisticsServiceImpl implements CardStatisticsService {

    @Autowired
    private CardStatisticsRepository repository;

    @Override
    public List<CardStatistics> findAll() {
        return repository.findAll();
    }

    @Override
    public Optional<CardStatistics> findById(Long statId) {
        return repository.findById(statId);
    }

    @Override
    public List<CardStatistics> findByStudentId(String studentId) {
        return repository.findByStudentId(studentId);
    }

    @Override
    public CardStatistics save(CardStatistics stats) {
        return repository.save(stats);
    }

    @Override
    public void deleteById(Long statId) {
        repository.deleteById(statId);
    }
}

